package com.yxw.live_vod_backend_boot.controller;

import com.yxw.live_vod_backend_boot.service.OrderBackendService;
import com.yxw.live_vod_facade.dto.OrderQueryDTO;
import com.yxw.live_vod_facade.vo.OrderVO;
import com.yxw.yxnet_cd_center.common.dto.PageVO;
import com.yxw.yxnet_cd_center.common.utils.BaseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 订单后台管理
 * @author xiexuxin
 * @date 2023-12-08
 */
@RestController
@Api(value = "订单后台管理", tags = "订单后台管理")
@Slf4j
@RequestMapping("/api/backend/order")
public class OrderBackendController {

    @Autowired
    private OrderBackendService orderBackendService;

    @ApiOperation(value = "获取订单列表")
    @PostMapping(value = "/get_order_list")
    public BaseResult<PageVO<OrderVO>> getOrderList(@RequestBody OrderQueryDTO queryDTO){
        return orderBackendService.getOrderList(queryDTO);
    }

    @ApiOperation(value = "获取订单详情")
    @PostMapping(value = "/get_order_by_id")
    public BaseResult getOrderById(@RequestParam("orderId") Long orderId){
        return orderBackendService.getOrderById(orderId);
    }

}
